<template>
	<view class="pages-box rel" v-if="coachInfo.id">
		<!-- #ifndef H5 -->
		<uni-nav-bar :fixed="true" :shadow="false" :statusBar="true" title="后台账密" leftIcon="icon-left"
			color="#ffffff" :backgroundColor="primaryColor">
		</uni-nav-bar>
		<view :style="{height:`${configInfo.navBarHeight}px`}"></view>
		<!-- #endif -->
		
		<view class="fill-base ml-lg mr-lg mt-lg pd-lg radius-16" v-if="coachInfo.account">
			<view class="f-paragraph">登录域名：{{coachInfo.account.domain_name}} </view>
			<view class="f-paragraph pt-md">账号：{{coachInfo.account.username}} </view>
			<view class="f-paragraph pt-md">密码：{{coachInfo.account.passwd_text}} </view>
		</view>
		<abnor v-if="!coachInfo.account"></abnor>
		<view class="space-footer"></view>
	</view>
</template>

<script>
	import {
		mapState,
		mapActions,
		mapMutations
	} from "vuex"
	import siteInfo from '@/siteinfo.js';
	
	export default {
		data() {
			return {
				
			}
		},
		computed: mapState({
			primaryColor: state => state.config.configInfo.primaryColor,
			subColor: state => state.config.configInfo.subColor,
			configInfo: state => state.config.configInfo,
			coachInfo: state => state.user.coachInfo,
		}),
		async onLoad(options) {
			this.$util.showLoading()
			this.initIndex()
		},
		methods: {
			...mapActions(['getConfigInfo','getCoachInfo']),
			async initIndex(refresh = false){
				if(!this.configInfo.id || refresh){
					await this.getConfigInfo()
				}
				if(!this.coachInfo.id || refresh){
					await this.getCoachInfo()
				}
				this.$util.hideAll()
			}
		},
	}
</script>


<style lang="scss">
	.pages-box {
		.use-box{
			margin: 20rpx 25rpx;
		}
		.out-btn{
			margin: 180rpx 25rpx 0 25rpx;
		}
	}
</style>
